<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        .box {
            width: 400px;
            margin: 0 auto;
            text-align: center;
            list-style: none;
            position: relative;
        }

        ul {
            list-style: none;
        }

        .tap ul {
            display: flex;
            justify-content: space-between;
            background-color: black;
            color: white;
        }

        .tap ul li {
            width: 100px;
        }

        .current {
            background-color: gray;
            color: black;
        }

        #content ul {
            position: absolute;
            top: 20px;
            left: 0px;
            display: none;
        }

        #content .x {
            display: block;
        }
    </style>
</head>

<body>
    <div class="box">
        <div class="tap">
            <ul id="uu">
                <li class="t1 current">第一课</li>
                <li class="t1">第二课</li>
                <li class="t1">第三课</li>
            </ul>
        </div>

        <div id="content">
            <ul class="x">
                <li>HTML,CSS,JS</li>
                <li>HTML,CSS,JS</li>
                <li>HTML,CSS,JS</li>
                <li>HTML,CSS,JS</li>
                <li>HTML,CSS,JS</li>
                <li>HTML,CSS,JS</li>
                <li>HTML,CSS,JS</li>
            </ul>

            <ul>
                <li>语文，数学，英语</li>
                <li>语文，数学，英语</li>
                <li>语文，数学，英语</li>
                <li>语文，数学，英语</li>
                <li>语文，数学，英语</li>
                <li>语文，数学，英语</li>
                <li>语文，数学，英语</li>
            </ul>

            <ul>
                <li>全栈，大数据，人工智能</li>
                <li>全栈，大数据，人工智能</li>
                <li>全栈，大数据，人工智能</li>
                <li>全栈，大数据，人工智能</li>
                <li>全栈，大数据，人工智能</li>
                <li>全栈，大数据，人工智能</li>
                <li>全栈，大数据，人工智能</li>
            </ul>
        </div>
    </div>

    <script>
      window.onload = function(){
          var lis = document.getElementById('uu').getElementsByTagName('li')
          var uls = document.getElementById('content').getElementsByTagName('ul')
          for(var i = 0; i<lis.length; i++){
              lis[i].index = i
              lis[i].onmouseenter=function(){
                  for(var Y=0;Y<lis.length;Y++){
                      lis[Y].className = ''
                      this.className = 'current'
                  }
                  for(var Y=0;Y<lis.length;Y++){
                    uls[Y].style.display = 'none'
                    uls[this.index].style.display = 'block'
                  }
              }
          }
      }
    </script>
</body>

</html>